home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F47468_xsValidateEnforceAttribute.xsl < prev   
Encoding:
Extensible Markup Language  |  2001-07-15  |  972 b   |  32 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE xsl:stylesheet [
  3.  
  4. <!ATTLIST thesis:opt id ID #REQUIRED>
  5. ]>
  6. <xsl:stylesheet version="1.0"
  7.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8.                 xmlns:thesis="http://www.silmaril.ie/thesis"
  9.                 exclude-result-prefixes="xsl thesis">
  10.  <xsl:output method="text"/>
  11.  
  12. <thesis:opts>
  13.   <thesis:opt id="foo" />
  14.   <thesis:opt id="bar" />
  15. </thesis:opts>
  16.  
  17. <xsl:output indent="yes"/>
  18. <xsl:template match="thesis">
  19.    <xsl:text>Options: </xsl:text>
  20.    <xsl:variable name="options" select="@options" />
  21.    <!-- change the context to the stylesheet document -->
  22.    <xsl:for-each select="document('')/*">
  23.       <!-- get the id attributes of any options identified by ID -->
  24.       <xsl:for-each select="id($options)/@id">
  25.          <xsl:value-of select="." />
  26.          <xsl:if test="position() != last()">, </xsl:if>
  27.       </xsl:for-each>
  28.    </xsl:for-each>
  29. </xsl:template>
  30.  
  31. </xsl:stylesheet>
  32.